import 'package:factoryside/bean/count_entity.dart';

countEntityFromJson(CountEntity data, Map<String, dynamic> json) {
	if (json['DoMailCount'] != null) {
		data.doMailCount = json['DoMailCount'] is String
				? int.tryParse(json['DoMailCount'])
				: json['DoMailCount'].toInt();
	}
	if (json['DoPayCount'] != null) {
		data.doPayCount = json['DoPayCount'] is String
				? int.tryParse(json['DoPayCount'])
				: json['DoPayCount'].toInt();
	}
	if (json['DoCheckCount'] != null) {
		data.doCheckCount = json['DoCheckCount'] is String
				? int.tryParse(json['DoCheckCount'])
				: json['DoCheckCount'].toInt();
	}
	if (json['DoReturnConfigCount'] != null) {
		data.doReturnConfigCount = json['DoReturnConfigCount'] is String
				? int.tryParse(json['DoReturnConfigCount'])
				: json['DoReturnConfigCount'].toInt();
	}
	if (json['DoDeliverGoodsCount'] != null) {
		data.doDeliverGoodsCount = json['DoDeliverGoodsCount'] is String
				? int.tryParse(json['DoDeliverGoodsCount'])
				: json['DoDeliverGoodsCount'].toInt();
	}
	if (json['CancalConunt'] != null) {
		data.cancalConunt = json['CancalConunt'] is String
				? int.tryParse(json['CancalConunt'])
				: json['CancalConunt'].toInt();
	}
	if (json['RemoteFeeDoCheckCount'] != null) {
		data.remoteFeeDoCheckCount = json['RemoteFeeDoCheckCount'] is String
				? int.tryParse(json['RemoteFeeDoCheckCount'])
				: json['RemoteFeeDoCheckCount'].toInt();
	}
	return data;
}

Map<String, dynamic> countEntityToJson(CountEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['DoMailCount'] = entity.doMailCount;
	data['DoPayCount'] = entity.doPayCount;
	data['DoCheckCount'] = entity.doCheckCount;
	data['DoReturnConfigCount'] = entity.doReturnConfigCount;
	data['DoDeliverGoodsCount'] = entity.doDeliverGoodsCount;
	data['CancalConunt'] = entity.cancalConunt;
	data['RemoteFeeDoCheckCount'] = entity.remoteFeeDoCheckCount;
	return data;
}